using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ShareTools.InfoPathFormsManager
{
    public partial class SelectWSPName : Form
    {
        public SelectWSPName()
        {
            InitializeComponent();
        }

        public string WspName
        {
            get
            {
                return textBox1.Text.Trim();
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text.Trim()))
            {
                MessageBox.Show("Please provide a WSP name.");
                return;
            }
            if (!textBox1.Text.Trim().EndsWith(".wsp"))
            {
                MessageBox.Show("Provide a proper name. (Hint: it ends with .wsp)");
                return;
            }
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
            this.Close();
            this.Dispose();
        }
    }
}